package com.ctshk.rpc.goods.mapper.provider;

import org.apache.ibatis.jdbc.SQL;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ctshk.rpc.goods.dto.CommoditySpecificationsPageDTO;
import com.ctshk.rpc.goods.req.CommoditySpecificationsNamePageReq;
import com.ctshk.rpc.goods.req.FreightTemplatePageReq;

/**
 * 商品规格名称-分页列表查询
 * @author 姜斌文
 * @since 2021-04-09
 */
public class CommoditySpecificationsNameProvider {
	
    public String findCommoditySpecificationsNameByPageAll(IPage<CommoditySpecificationsPageDTO> page,CommoditySpecificationsNamePageReq pageReq) {
    	String sql = new SQL() {{
                SELECT("t.id, t.specifications_name");
                FROM("t_commodity_specifications_name t");
                if(pageReq.getUserIds() != null){
                    WHERE("t.create_id in (${pageReq.userIds})");
                }
                WHERE("t.is_deleted = 0");
                ORDER_BY("t.gmt_create DESC");
            }}.toString();
            return sql;
    }
}
